<html>
<head>
<title>Valida CPF</title>
<style>
		body, p, div, td, input, select, textarea {
			font-family: verdana,arial,helvetica;
			font-size:10px;
			color:#27364D;
			text-decoration: none;
		}
		h1 {
			font-family: verdana,arial,helvetica;
			font-size:30px;
			color:#27364D;
			text-decoration: none;
		}
		input,textarea {
			@if (is.ie) {
				color: #efefef; background-color:#efefef; border: 1px solid #060606 ;
				/*border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; */
			}
		}
		a { 
			text-decoration:none; 
			color: #27364d;
		}
		textarea { overflow:auto }
	</style>
<script language="Javascript">
	function validaCPF(cpf) {
		valor = true;
		erro = new String;
		if (cpf.length < 11) erro += "Sao necessarios 11 digitos para verificacao do CPF! \n\n"; 

		if (cpf == "00000000000" || cpf == "11111111111" || cpf == "22222222222" || cpf == "33333333333" || cpf == "44444444444" || cpf == "55555555555" || cpf == "66666666666" || cpf == "77777777777" || cpf == "88888888888" || cpf == "99999999999")
		{
			  erro += "Numero de CPF invalido!"
		}
		var a = [];
		var b = new Number;
		var c = 11;
		for (i=0; i<11; i++){
			a[i] = cpf.charAt(i);
			if (i < 9) b += (a[i] *  --c);
		}
		if ((x = b % 11) < 2) { a[9] = 0 } else { a[9] = 11-x }
		b = 0;
		c = 11;
		for (y=0; y<10; y++) b += (a[y] *  c--); 
		if ((x = b % 11) < 2) { a[10] = 0; } else { a[10] = 11-x; }
		if ((cpf.charAt(9) != a[9]) || (cpf.charAt(10) != a[10])){
			erro +="Digito verificador com problema!";
		}
		if (erro.length > 0){
			alert(erro);
			return false;
		}
		return true;
	}
</script>
</head>
<body leftmargin="10" topmargin="10" marginwidth="10" marginheight="10">
<h1>Valida CPF</h1>
<form action="validaCPF.htm" name="validacao" onSubmit="">
	<input type="text" name="cpfID" id="cpfID" maxlength="11" value="">
</form>
<input name="Button" type="button" value="enviar" onClick="validaCPF(validacao.cpfID.value)">
<p>&nbsp;</p>
Digite o numero do CPF 

sem utilizar os caracteres "." ou "-".
</body>
</html>